package org.learn.intermediate.com.debug_;
//debug对象创建的过程，加深对调试的理解；

public class DebugExercise {
    public static void main(String[] args) {
        Person2 person2 = new Person2("jack", 18);
        System.out.println(person2);
    }
}
class Person2 {
    private String name;
    private int age;

    public Person2(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person2{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}